<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		computed: {
			...mapState('pb_Prototype', ['statusBarH', 'customBarH','paddingTop','paddingButtom','menuHeight'])
		},
		onLaunch: function() {
			console.warn('当前组件仅支持 uni_modules 目录结构 ，请升级 HBuilderX 到 3.1.0 版本以上！')
			console.log('App Launch')
			uni.getSystemInfo({
				success: (e) => {
					let statusBar = e.statusBarHeight
					let customBar
					let menu = wx.getMenuButtonBoundingClientRect()
					customBar = menu.bottom + menu.top - statusBar
					this.update_statusBarH(statusBar)
					this.update_customBarH(customBar)
					this.update_paddingTop(menu.top)
					this.update_paddingButtom(menu.bottom)
					this.update_menuHeiht(menu.height)
					this.update_windowWidth(e.windowWidth)
					this.update_menuleft(menu.left)
					console.log('menu.height:'+this.menuHeight)
					console.log('statusBar:'+statusBar)
					console.log('customBar:'+customBar)
					console.log('menu.top:'+menu.top)
					console.log('menu.bottom:'+this.paddingButtom)
					console.log('e.windowWidth:'+e.windowWidth)
					console.log('menu.left:'+menu.left)

				}
			})
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			...mapMutations('pb_Prototype', ['update_statusBarH', 'update_customBarH','update_paddingTop','update_paddingButtom','update_menuHeiht','update_windowWidth','update_menuleft'])
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';

	// 设置整个项目的背景色
	page {
		background-color: #f5f5f5;
	}

	/* #endif */
	.example-info {
		font-size: 14px;
		color: #333;
		padding: 10px;
	}
</style>